<!-- 巡检 -->
<template>
  <div>
    <h4>巡检记录</h4>
    <el-table v-loading="loading" :data="noticeList">
      <el-table-column label="巡检编号" align="center" min-width="150">
        <template slot-scope="scope">
          {{ scope.row.inspectionPlanNum || '-' }}
        </template>
      </el-table-column>

      <el-table-column label="巡检员" align="center" min-width="130">
        <template slot-scope="scope">
          <label v-for="(v,i) in scope.row.inspectionInspectorVoList" :key="i">
            {{v.inspectorName}}
            <span v-if="i!==scope.row.inspectionInspectorVoList.length-1">,</span>
          </label>
        </template>
      </el-table-column>
      <el-table-column label="巡检结果" align="center" min-width="130">
        <template slot-scope="scope">
          <dict-tag :options="inspectionStatus" :value="scope.row.equipmentInspectionStatus" />
        </template>
      </el-table-column>
      <el-table-column label="完成时间" align="center" min-width="150">
        <template slot-scope="scope">
          {{ scope.row.actualInspectionDate || '-' }}
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" min-width="150" show-overflow-tooltip>
        <template slot-scope="scope">
          {{ scope.row.remark || '-' }}
        </template>
      </el-table-column>
    </el-table>
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />
  </div>
</template>

<script>
import { getinspectionlist } from '@/api/equipment/equipment.js'
export default {
  name: 'InspectionRecord',
  props: ['rowObj'],
  data () {
    return {
      total: 0,
      loading: false,
      noticeList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10
      },
    }
  },
  created () {
    this.getList();
  },
  methods: {
    async getList () {
      this.loading = true
      let params = {
        ...this.queryParams,
        equipmentAccountId: this.rowObj.equipmentAccountId
      }
      let data = await getinspectionlist(params);
      this.total = data.total
      this.noticeList = data.data
      this.loading = false
    },
  }
}
</script>

<style>

</style>